<template>
  <div id="app">
    <nav>
      <router-link to="/">Home</router-link> |
      <router-link to="/help">帮助</router-link> |
      <h1>js跳转</h1>
      <button @click="goHelp">帮助-path</button>
      <button @click="goHelp2">帮助-name</button>
      <hr>
      <RouterLink to="/news">跳的新闻模块</RouterLink>
    </nav>
    <router-view/>
  </div>
</template>
<script>
import { RouterLink } from 'vue-router';

export default{
  methods:{
    goHelp(){
      // console.log("666");
      this.$router.push({
        path:"/help"
      })
    },
    goHelp2(){
      // console.log("666");
      this.$router.push({
        name:"help2",
        query:{
          abc:"666"
        }
      })
    }
  }
}
</script>
<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

nav {
  padding: 30px;
}

nav a {
  font-weight: bold;
  color: #2c3e50;
}

nav a.router-link-exact-active {
  color: #42b983;
}
</style>
